﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class BM_BM5 : BasePage
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    protected override void Page_LoadAlways()
    {
        string orderId = string.Empty;
        string emYear = string.Empty;
        string emNum = string.Empty;
        string emId = string.Empty;
        base.Page_LoadAlways();
        //string orderid = string.Empty;
        if (Request.QueryString.Count > 0)
        {
            orderId = Request.Params["OrderID"].ToString();
        }
        else
        {
            Response.Redirect(BSUtility.mainUrl + "default.aspx");
        }
        

        DataTable dt = Exam.getOrderInfoByOrderID(orderId);
        if (dt.Rows.Count > 0)
        {
            DataRow dr = dt.Rows[0];
            emId = dr["EmID"].ToString();
            NoAccess.JumpToDefaultPageNoAccessTime(this, emId);
            //如果订单未完成，直接转回考试选择页
            if (dr["OrderState"].ToString() == "9")
            {
                
            }
            else
                Response.Redirect(BSUtility.mainUrl + "ExamSelect.aspx");
        }
        //更新报名状态为已完成
        DataTable dt_apply = Exam.getApplyInfoByOrderId(orderId);
        if (dt_apply.Rows.Count > 0)
        {
            DataRow dr_apply = dt_apply.Rows[0];
            emNum = dr_apply["EmNum"].ToString();
            emYear = dr_apply["EmYear"].ToString();
        }
        
       
    }
}